package com.luocj.brvah_srl.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.luocj.brvah_srl.R;
import com.luocj.brvah_srl.entity.MultiModel;

import java.util.List;

public class MultiAdapter extends BaseMultiItemQuickAdapter<MultiModel, BaseViewHolder> {


    public MultiAdapter(Context context, List<MultiModel> data) {
        super(data);

        addItemType(MultiModel.TEXT, R.layout.item_multi_one);
        addItemType(MultiModel.TEXT_PIC, R.layout.item_multi_two);
    }

    @Override
    protected void convert(BaseViewHolder holder, MultiModel item) {
        switch (holder.getItemViewType()) {
            case MultiModel.TEXT:
                holder.setText(R.id.tv_multi_onecc, item.getItemType() + "");
                break;
            case MultiModel.TEXT_PIC:
                holder.setText(R.id.tv_multi_two, item.getItemType() + "");
                break;
            default:
                break;
        }
    }
}
